package main

import (
	"context"
	"fmt"
	"go_ai/internal/provider/deepseek"
	"go_ai/pkg/config"
	"go_ai/pkg/console"
	"go_ai/pkg/model"
	"net/http"
)

func main() {
	cfg := config.Config{
		BaseURL:    "https://api.lkeap.cloud.tencent.com",
		APIKey:     "API-KEY",
		HTTPClient: &http.Client{},
	}
	// 初始化deepseek
	d := deepseek.NewDeepSeek(cfg)
	// 封装请求体
	body := model.Request{
		Model:    "deepseek-r1",
		Messages: []model.Message{{Role: "system", Content: "You are a helpful assistant."}, {Role: "user", Content: "你是谁"}},
	}
	// 同步调用
	chat, err := d.Chat(context.Background(), body)
	if err != nil {
		panic(err)
	}
	fmt.Println(chat.Content)
	// 流式调用
	stream, _ := d.Stream(context.Background(), body)
	console.Content(stream)
}
